package lab02;

public class Golem implements Boss {
    private String name;
    private int Hp;
    public Golem(){

    }
    public Golem(String name,int Hp){
        this.name=name;
        this.Hp=Hp;
    }
    public String getName(){
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getHp() {
        return Hp;
    }

    public void setHp(int hp) {
        Hp = hp;
    }

    public void attack() {
        System.out.println( "Golem发动了攻击");
    }

    @Override
    public void move() {
        System.out.println( "Golem进行了曲线移动");
    }

    @Override
    public void addhp() {
        while (Hp > 0) {
            if (Hp >= 10) {
                System.out.println("受到攻击-25");
                Hp = Hp - 25;
                System.out.println("生命剩余值:"+Hp);

            }
            if (Hp > 0 && Hp < 10) {
                Hp += 20;
                System.out.println("生命低于10  +20");
                System.out.println("生命剩余值:"+Hp);
            }
            if (Hp <= 25) {
                Hp-=25;
                System.out.println("受到攻击-25");
                System.out.println("生命剩余值:"+Hp);
                System.out.println("很遗憾您已死亡");

                break;
            }
        }
    }
}

